Option Strict On
Option Explicit On 

Public Class UFrame
    Inherits System.Windows.Forms.UserControl

#Region " Windows Form Designer generated code "

    Public Sub New()
        MyBase.New()

        'This call is required by the Windows Form Designer.
        InitializeComponent()

        'Add any initialization after the InitializeComponent() call

    End Sub

    'Form overrides dispose to clean up the component list.
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If Not (components Is Nothing) Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    Friend WithEvents lblBorderWidth As System.Windows.Forms.Label
    Friend WithEvents cboBorder3DStyle As System.Windows.Forms.ComboBox
    Friend WithEvents gbBorder As System.Windows.Forms.GroupBox
    Friend WithEvents lblBorder3DStyle As System.Windows.Forms.Label
    Friend WithEvents chkCloseAtPageBreak As System.Windows.Forms.CheckBox
    Friend WithEvents nudBorderWidth As System.Windows.Forms.NumericUpDown
    Friend WithEvents PictureBox1 As System.Windows.Forms.PictureBox
    Friend WithEvents PictureBox2 As System.Windows.Forms.PictureBox
    Friend WithEvents uclBorderColor As Avand.UColor
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(UFrame))
        Me.gbBorder = New System.Windows.Forms.GroupBox
        Me.uclBorderColor = New Avand.UColor
        Me.lblBorderWidth = New System.Windows.Forms.Label
        Me.nudBorderWidth = New System.Windows.Forms.NumericUpDown
        Me.lblBorder3DStyle = New System.Windows.Forms.Label
        Me.cboBorder3DStyle = New System.Windows.Forms.ComboBox
        Me.chkCloseAtPageBreak = New System.Windows.Forms.CheckBox
        Me.gbBorder.SuspendLayout()
        CType(Me.nudBorderWidth, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.SuspendLayout()
        '
        'gbBorder
        '
        Me.gbBorder.AccessibleDescription = resources.GetString("gbBorder.AccessibleDescription")
        Me.gbBorder.AccessibleName = resources.GetString("gbBorder.AccessibleName")
        Me.gbBorder.Anchor = CType(resources.GetObject("gbBorder.Anchor"), System.Windows.Forms.AnchorStyles)
        Me.gbBorder.BackgroundImage = CType(resources.GetObject("gbBorder.BackgroundImage"), System.Drawing.Image)
        Me.gbBorder.Controls.Add(Me.uclBorderColor)
        Me.gbBorder.Controls.Add(Me.lblBorderWidth)
        Me.gbBorder.Controls.Add(Me.nudBorderWidth)
        Me.gbBorder.Controls.Add(Me.lblBorder3DStyle)
        Me.gbBorder.Controls.Add(Me.cboBorder3DStyle)
        Me.gbBorder.Dock = CType(resources.GetObject("gbBorder.Dock"), System.Windows.Forms.DockStyle)
        Me.gbBorder.Enabled = CType(resources.GetObject("gbBorder.Enabled"), Boolean)
        Me.gbBorder.Font = CType(resources.GetObject("gbBorder.Font"), System.Drawing.Font)
        Me.gbBorder.ImeMode = CType(resources.GetObject("gbBorder.ImeMode"), System.Windows.Forms.ImeMode)
        Me.gbBorder.Location = CType(resources.GetObject("gbBorder.Location"), System.Drawing.Point)
        Me.gbBorder.Name = "gbBorder"
        Me.gbBorder.RightToLeft = CType(resources.GetObject("gbBorder.RightToLeft"), System.Windows.Forms.RightToLeft)
        Me.gbBorder.Size = CType(resources.GetObject("gbBorder.Size"), System.Drawing.Size)
        Me.gbBorder.TabIndex = CType(resources.GetObject("gbBorder.TabIndex"), Integer)
        Me.gbBorder.TabStop = False
        Me.gbBorder.Text = resources.GetString("gbBorder.Text")
        Me.gbBorder.Visible = CType(resources.GetObject("gbBorder.Visible"), Boolean)
        '
        'uclBorderColor
        '
        Me.uclBorderColor.AccessibleDescription = resources.GetString("uclBorderColor.AccessibleDescription")
        Me.uclBorderColor.AccessibleName = resources.GetString("uclBorderColor.AccessibleName")
        Me.uclBorderColor.Anchor = CType(resources.GetObject("uclBorderColor.Anchor"), System.Windows.Forms.AnchorStyles)
        Me.uclBorderColor.AutoScroll = CType(resources.GetObject("uclBorderColor.AutoScroll"), Boolean)
        Me.uclBorderColor.AutoScrollMargin = CType(resources.GetObject("uclBorderColor.AutoScrollMargin"), System.Drawing.Size)
        Me.uclBorderColor.AutoScrollMinSize = CType(resources.GetObject("uclBorderColor.AutoScrollMinSize"), System.Drawing.Size)
        Me.uclBorderColor.BackgroundImage = CType(resources.GetObject("uclBorderColor.BackgroundImage"), System.Drawing.Image)
        Me.uclBorderColor.Caption = resources.GetString("uclBorderColor.Caption")
        Me.uclBorderColor.Color = System.Drawing.SystemColors.Control
        Me.uclBorderColor.Dock = CType(resources.GetObject("uclBorderColor.Dock"), System.Windows.Forms.DockStyle)
        Me.uclBorderColor.Enabled = CType(resources.GetObject("uclBorderColor.Enabled"), Boolean)
        Me.uclBorderColor.Font = CType(resources.GetObject("uclBorderColor.Font"), System.Drawing.Font)
        Me.uclBorderColor.ImeMode = CType(resources.GetObject("uclBorderColor.ImeMode"), System.Windows.Forms.ImeMode)
        Me.uclBorderColor.Location = CType(resources.GetObject("uclBorderColor.Location"), System.Drawing.Point)
        Me.uclBorderColor.Name = "uclBorderColor"
        Me.uclBorderColor.RightToLeft = CType(resources.GetObject("uclBorderColor.RightToLeft"), System.Windows.Forms.RightToLeft)
        Me.uclBorderColor.Size = CType(resources.GetObject("uclBorderColor.Size"), System.Drawing.Size)
        Me.uclBorderColor.TabIndex = CType(resources.GetObject("uclBorderColor.TabIndex"), Integer)
        Me.uclBorderColor.Visible = CType(resources.GetObject("uclBorderColor.Visible"), Boolean)
        '
        'lblBorderWidth
        '
        Me.lblBorderWidth.AccessibleDescription = resources.GetString("lblBorderWidth.AccessibleDescription")
        Me.lblBorderWidth.AccessibleName = resources.GetString("lblBorderWidth.AccessibleName")
        Me.lblBorderWidth.Anchor = CType(resources.GetObject("lblBorderWidth.Anchor"), System.Windows.Forms.AnchorStyles)
        Me.lblBorderWidth.AutoSize = CType(resources.GetObject("lblBorderWidth.AutoSize"), Boolean)
        Me.lblBorderWidth.Dock = CType(resources.GetObject("lblBorderWidth.Dock"), System.Windows.Forms.DockStyle)
        Me.lblBorderWidth.Enabled = CType(resources.GetObject("lblBorderWidth.Enabled"), Boolean)
        Me.lblBorderWidth.Font = CType(resources.GetObject("lblBorderWidth.Font"), System.Drawing.Font)
        Me.lblBorderWidth.Image = CType(resources.GetObject("lblBorderWidth.Image"), System.Drawing.Image)
        Me.lblBorderWidth.ImageAlign = CType(resources.GetObject("lblBorderWidth.ImageAlign"), System.Drawing.ContentAlignment)
        Me.lblBorderWidth.ImageIndex = CType(resources.GetObject("lblBorderWidth.ImageIndex"), Integer)
        Me.lblBorderWidth.ImeMode = CType(resources.GetObject("lblBorderWidth.ImeMode"), System.Windows.Forms.ImeMode)
        Me.lblBorderWidth.Location = CType(resources.GetObject("lblBorderWidth.Location"), System.Drawing.Point)
        Me.lblBorderWidth.Name = "lblBorderWidth"
        Me.lblBorderWidth.RightToLeft = CType(resources.GetObject("lblBorderWidth.RightToLeft"), System.Windows.Forms.RightToLeft)
        Me.lblBorderWidth.Size = CType(resources.GetObject("lblBorderWidth.Size"), System.Drawing.Size)
        Me.lblBorderWidth.TabIndex = CType(resources.GetObject("lblBorderWidth.TabIndex"), Integer)
        Me.lblBorderWidth.Text = resources.GetString("lblBorderWidth.Text")
        Me.lblBorderWidth.TextAlign = CType(resources.GetObject("lblBorderWidth.TextAlign"), System.Drawing.ContentAlignment)
        Me.lblBorderWidth.Visible = CType(resources.GetObject("lblBorderWidth.Visible"), Boolean)
        '
        'nudBorderWidth
        '
        Me.nudBorderWidth.AccessibleDescription = resources.GetString("nudBorderWidth.AccessibleDescription")
        Me.nudBorderWidth.AccessibleName = resources.GetString("nudBorderWidth.AccessibleName")
        Me.nudBorderWidth.Anchor = CType(resources.GetObject("nudBorderWidth.Anchor"), System.Windows.Forms.AnchorStyles)
        Me.nudBorderWidth.Dock = CType(resources.GetObject("nudBorderWidth.Dock"), System.Windows.Forms.DockStyle)
        Me.nudBorderWidth.Enabled = CType(resources.GetObject("nudBorderWidth.Enabled"), Boolean)
        Me.nudBorderWidth.Font = CType(resources.GetObject("nudBorderWidth.Font"), System.Drawing.Font)
        Me.nudBorderWidth.ImeMode = CType(resources.GetObject("nudBorderWidth.ImeMode"), System.Windows.Forms.ImeMode)
        Me.nudBorderWidth.Location = CType(resources.GetObject("nudBorderWidth.Location"), System.Drawing.Point)
        Me.nudBorderWidth.Maximum = New Decimal(New Integer() {10000, 0, 0, 0})
        Me.nudBorderWidth.Name = "nudBorderWidth"
        Me.nudBorderWidth.RightToLeft = CType(resources.GetObject("nudBorderWidth.RightToLeft"), System.Windows.Forms.RightToLeft)
        Me.nudBorderWidth.Size = CType(resources.GetObject("nudBorderWidth.Size"), System.Drawing.Size)
        Me.nudBorderWidth.TabIndex = CType(resources.GetObject("nudBorderWidth.TabIndex"), Integer)
        Me.nudBorderWidth.TextAlign = CType(resources.GetObject("nudBorderWidth.TextAlign"), System.Windows.Forms.HorizontalAlignment)
        Me.nudBorderWidth.ThousandsSeparator = CType(resources.GetObject("nudBorderWidth.ThousandsSeparator"), Boolean)
        Me.nudBorderWidth.UpDownAlign = CType(resources.GetObject("nudBorderWidth.UpDownAlign"), System.Windows.Forms.LeftRightAlignment)
        Me.nudBorderWidth.Visible = CType(resources.GetObject("nudBorderWidth.Visible"), Boolean)
        '
        'lblBorder3DStyle
        '
        Me.lblBorder3DStyle.AccessibleDescription = resources.GetString("lblBorder3DStyle.AccessibleDescription")
        Me.lblBorder3DStyle.AccessibleName = resources.GetString("lblBorder3DStyle.AccessibleName")
        Me.lblBorder3DStyle.Anchor = CType(resources.GetObject("lblBorder3DStyle.Anchor"), System.Windows.Forms.AnchorStyles)
        Me.lblBorder3DStyle.AutoSize = CType(resources.GetObject("lblBorder3DStyle.AutoSize"), Boolean)
        Me.lblBorder3DStyle.Dock = CType(resources.GetObject("lblBorder3DStyle.Dock"), System.Windows.Forms.DockStyle)
        Me.lblBorder3DStyle.Enabled = CType(resources.GetObject("lblBorder3DStyle.Enabled"), Boolean)
        Me.lblBorder3DStyle.Font = CType(resources.GetObject("lblBorder3DStyle.Font"), System.Drawing.Font)
        Me.lblBorder3DStyle.Image = CType(resources.GetObject("lblBorder3DStyle.Image"), System.Drawing.Image)
        Me.lblBorder3DStyle.ImageAlign = CType(resources.GetObject("lblBorder3DStyle.ImageAlign"), System.Drawing.ContentAlignment)
        Me.lblBorder3DStyle.ImageIndex = CType(resources.GetObject("lblBorder3DStyle.ImageIndex"), Integer)
        Me.lblBorder3DStyle.ImeMode = CType(resources.GetObject("lblBorder3DStyle.ImeMode"), System.Windows.Forms.ImeMode)
        Me.lblBorder3DStyle.Location = CType(resources.GetObject("lblBorder3DStyle.Location"), System.Drawing.Point)
        Me.lblBorder3DStyle.Name = "lblBorder3DStyle"
        Me.lblBorder3DStyle.RightToLeft = CType(resources.GetObject("lblBorder3DStyle.RightToLeft"), System.Windows.Forms.RightToLeft)
        Me.lblBorder3DStyle.Size = CType(resources.GetObject("lblBorder3DStyle.Size"), System.Drawing.Size)
        Me.lblBorder3DStyle.TabIndex = CType(resources.GetObject("lblBorder3DStyle.TabIndex"), Integer)
        Me.lblBorder3DStyle.Text = resources.GetString("lblBorder3DStyle.Text")
        Me.lblBorder3DStyle.TextAlign = CType(resources.GetObject("lblBorder3DStyle.TextAlign"), System.Drawing.ContentAlignment)
        Me.lblBorder3DStyle.Visible = CType(resources.GetObject("lblBorder3DStyle.Visible"), Boolean)
        '
        'cboBorder3DStyle
        '
        Me.cboBorder3DStyle.AccessibleDescription = resources.GetString("cboBorder3DStyle.AccessibleDescription")
        Me.cboBorder3DStyle.AccessibleName = resources.GetString("cboBorder3DStyle.AccessibleName")
        Me.cboBorder3DStyle.Anchor = CType(resources.GetObject("cboBorder3DStyle.Anchor"), System.Windows.Forms.AnchorStyles)
        Me.cboBorder3DStyle.BackgroundImage = CType(resources.GetObject("cboBorder3DStyle.BackgroundImage"), System.Drawing.Image)
        Me.cboBorder3DStyle.Dock = CType(resources.GetObject("cboBorder3DStyle.Dock"), System.Windows.Forms.DockStyle)
        Me.cboBorder3DStyle.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
        Me.cboBorder3DStyle.Enabled = CType(resources.GetObject("cboBorder3DStyle.Enabled"), Boolean)
        Me.cboBorder3DStyle.Font = CType(resources.GetObject("cboBorder3DStyle.Font"), System.Drawing.Font)
        Me.cboBorder3DStyle.ImeMode = CType(resources.GetObject("cboBorder3DStyle.ImeMode"), System.Windows.Forms.ImeMode)
        Me.cboBorder3DStyle.IntegralHeight = CType(resources.GetObject("cboBorder3DStyle.IntegralHeight"), Boolean)
        Me.cboBorder3DStyle.ItemHeight = CType(resources.GetObject("cboBorder3DStyle.ItemHeight"), Integer)
        Me.cboBorder3DStyle.Location = CType(resources.GetObject("cboBorder3DStyle.Location"), System.Drawing.Point)
        Me.cboBorder3DStyle.MaxDropDownItems = CType(resources.GetObject("cboBorder3DStyle.MaxDropDownItems"), Integer)
        Me.cboBorder3DStyle.MaxLength = CType(resources.GetObject("cboBorder3DStyle.MaxLength"), Integer)
        Me.cboBorder3DStyle.Name = "cboBorder3DStyle"
        Me.cboBorder3DStyle.RightToLeft = CType(resources.GetObject("cboBorder3DStyle.RightToLeft"), System.Windows.Forms.RightToLeft)
        Me.cboBorder3DStyle.Size = CType(resources.GetObject("cboBorder3DStyle.Size"), System.Drawing.Size)
        Me.cboBorder3DStyle.TabIndex = CType(resources.GetObject("cboBorder3DStyle.TabIndex"), Integer)
        Me.cboBorder3DStyle.Text = resources.GetString("cboBorder3DStyle.Text")
        Me.cboBorder3DStyle.Visible = CType(resources.GetObject("cboBorder3DStyle.Visible"), Boolean)
        '
        'chkCloseAtPageBreak
        '
        Me.chkCloseAtPageBreak.AccessibleDescription = resources.GetString("chkCloseAtPageBreak.AccessibleDescription")
        Me.chkCloseAtPageBreak.AccessibleName = resources.GetString("chkCloseAtPageBreak.AccessibleName")
        Me.chkCloseAtPageBreak.Anchor = CType(resources.GetObject("chkCloseAtPageBreak.Anchor"), System.Windows.Forms.AnchorStyles)
        Me.chkCloseAtPageBreak.Appearance = CType(resources.GetObject("chkCloseAtPageBreak.Appearance"), System.Windows.Forms.Appearance)
        Me.chkCloseAtPageBreak.BackgroundImage = CType(resources.GetObject("chkCloseAtPageBreak.BackgroundImage"), System.Drawing.Image)
        Me.chkCloseAtPageBreak.CheckAlign = CType(resources.GetObject("chkCloseAtPageBreak.CheckAlign"), System.Drawing.ContentAlignment)
        Me.chkCloseAtPageBreak.Dock = CType(resources.GetObject("chkCloseAtPageBreak.Dock"), System.Windows.Forms.DockStyle)
        Me.chkCloseAtPageBreak.Enabled = CType(resources.GetObject("chkCloseAtPageBreak.Enabled"), Boolean)
        Me.chkCloseAtPageBreak.FlatStyle = CType(resources.GetObject("chkCloseAtPageBreak.FlatStyle"), System.Windows.Forms.FlatStyle)
        Me.chkCloseAtPageBreak.Font = CType(resources.GetObject("chkCloseAtPageBreak.Font"), System.Drawing.Font)
        Me.chkCloseAtPageBreak.Image = CType(resources.GetObject("chkCloseAtPageBreak.Image"), System.Drawing.Image)
        Me.chkCloseAtPageBreak.ImageAlign = CType(resources.GetObject("chkCloseAtPageBreak.ImageAlign"), System.Drawing.ContentAlignment)
        Me.chkCloseAtPageBreak.ImageIndex = CType(resources.GetObject("chkCloseAtPageBreak.ImageIndex"), Integer)
        Me.chkCloseAtPageBreak.ImeMode = CType(resources.GetObject("chkCloseAtPageBreak.ImeMode"), System.Windows.Forms.ImeMode)
        Me.chkCloseAtPageBreak.Location = CType(resources.GetObject("chkCloseAtPageBreak.Location"), System.Drawing.Point)
        Me.chkCloseAtPageBreak.Name = "chkCloseAtPageBreak"
        Me.chkCloseAtPageBreak.RightToLeft = CType(resources.GetObject("chkCloseAtPageBreak.RightToLeft"), System.Windows.Forms.RightToLeft)
        Me.chkCloseAtPageBreak.Size = CType(resources.GetObject("chkCloseAtPageBreak.Size"), System.Drawing.Size)
        Me.chkCloseAtPageBreak.TabIndex = CType(resources.GetObject("chkCloseAtPageBreak.TabIndex"), Integer)
        Me.chkCloseAtPageBreak.Text = resources.GetString("chkCloseAtPageBreak.Text")
        Me.chkCloseAtPageBreak.TextAlign = CType(resources.GetObject("chkCloseAtPageBreak.TextAlign"), System.Drawing.ContentAlignment)
        Me.chkCloseAtPageBreak.Visible = CType(resources.GetObject("chkCloseAtPageBreak.Visible"), Boolean)
        '
        'UFrame
        '
        Me.AccessibleDescription = resources.GetString("$this.AccessibleDescription")
        Me.AccessibleName = resources.GetString("$this.AccessibleName")
        Me.AutoScroll = CType(resources.GetObject("$this.AutoScroll"), Boolean)
        Me.AutoScrollMargin = CType(resources.GetObject("$this.AutoScrollMargin"), System.Drawing.Size)
        Me.AutoScrollMinSize = CType(resources.GetObject("$this.AutoScrollMinSize"), System.Drawing.Size)
        Me.BackgroundImage = CType(resources.GetObject("$this.BackgroundImage"), System.Drawing.Image)
        Me.Controls.Add(Me.chkCloseAtPageBreak)
        Me.Controls.Add(Me.gbBorder)
        Me.Enabled = CType(resources.GetObject("$this.Enabled"), Boolean)
        Me.Font = CType(resources.GetObject("$this.Font"), System.Drawing.Font)
        Me.ImeMode = CType(resources.GetObject("$this.ImeMode"), System.Windows.Forms.ImeMode)
        Me.Location = CType(resources.GetObject("$this.Location"), System.Drawing.Point)
        Me.Name = "UFrame"
        Me.RightToLeft = CType(resources.GetObject("$this.RightToLeft"), System.Windows.Forms.RightToLeft)
        Me.Size = CType(resources.GetObject("$this.Size"), System.Drawing.Size)
        Me.gbBorder.ResumeLayout(False)
        CType(Me.nudBorderWidth, System.ComponentModel.ISupportInitialize).EndInit()
        Me.ResumeLayout(False)

    End Sub

#End Region

    Public Event ValueChanged As EventHandler

    Private Sub UFrame_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        AddHandler nudBorderWidth.ValueChanged, AddressOf OnValueChanged : AddHandler nudBorderWidth.TextChanged, AddressOf OnValueChanged
        AddHandler uclBorderColor.ValueChanged, AddressOf OnValueChanged
        AddHandler cboBorder3DStyle.SelectionChangeCommitted, AddressOf OnValueChanged
        AddHandler chkCloseAtPageBreak.CheckedChanged, AddressOf OnValueChanged
    End Sub

    Protected Sub OnValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
        RaiseEvent ValueChanged(Me, New EventArgs)
    End Sub

    Public Sub Prepare()
        cboBorder3DStyle.Items.Clear()
        cboBorder3DStyle.Items.Add(Border3DStyle.RaisedOuter)
        cboBorder3DStyle.Items.Add(Border3DStyle.SunkenOuter)
        cboBorder3DStyle.Items.Add(Border3DStyle.RaisedInner)
        cboBorder3DStyle.Items.Add(Border3DStyle.Raised)
        cboBorder3DStyle.Items.Add(Border3DStyle.Etched)
        cboBorder3DStyle.Items.Add(Border3DStyle.SunkenInner)
        cboBorder3DStyle.Items.Add(Border3DStyle.Bump)
        cboBorder3DStyle.Items.Add(Border3DStyle.Sunken)
        cboBorder3DStyle.Items.Add(Border3DStyle.Adjust)
        cboBorder3DStyle.Items.Add(Border3DStyle.Flat)
    End Sub

    Public Sub Read(ByVal frame As Model10.Frame)
        nudBorderWidth.Value = CDec(frame.BorderWidth)
        uclBorderColor.Color = frame.BorderColor
        cboBorder3DStyle.SelectedItem = frame.Border3DStyle
        chkCloseAtPageBreak.Checked = frame.CloseAtPageBreak
    End Sub
    Public Sub Write(ByVal frame As Model10.Frame)
        frame.BorderWidth = nudBorderWidth.Value
        frame.BorderColor = uclBorderColor.Color
        frame.Border3DStyle = CType(cboBorder3DStyle.SelectedItem, Border3DStyle)
        frame.CloseAtPageBreak = chkCloseAtPageBreak.Checked
    End Sub
End Class